using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Raster._RasterProcessing
{
    /// <summary>
    /// <para>Raster To DTED</para>
    /// <para>Splits a raster dataset into separate files based on the DTED tiling structure.</para>
    /// <para>根据 DTED 切片结构将栅格数据集拆分为单独的文件。</para>
    /// </summary>    
    [DisplayName("Raster To DTED")]
    public class RasterToDTED : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RasterToDTED()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input Raster</para>
        /// <para>Select a single band raster dataset that represents elevation.</para>
        /// <para>选择表示高程的单个波段栅格数据集。</para>
        /// </param>
        /// <param name="_out_folder">
        /// <para>Output Folder</para>
        /// <para>Select a destination where the folder structure and DTED files will be created.</para>
        /// <para>选择将在其中创建文件夹结构和 DTED 文件的目标。</para>
        /// </param>
        /// <param name="_dted_level">
        /// <para>DTED Level</para>
        /// <para><xdoc>
        ///   <para>Select an appropriate level based on the resolution of your elevation data.</para>
        ///   <bulletList>
        ///     <bullet_item>Level 0— 900 m</bullet_item><para/>
        ///     <bullet_item>Level 1— 90 m</bullet_item><para/>
        ///     <bullet_item>Level 2—30 m</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>根据高程数据的分辨率选择适当的标高。</para>
        ///   <bulletList>
        ///     <bullet_item>0— 900 米</bullet_item><para/>
        ///     <bullet_item>1 层— 90 米</bullet_item><para/>
        ///     <bullet_item>2 级—30 m</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public RasterToDTED(object _in_raster, object _out_folder, _dted_level_value _dted_level)
        {
            this._in_raster = _in_raster;
            this._out_folder = _out_folder;
            this._dted_level = _dted_level;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Raster To DTED";

        public override string CallName => "management.RasterToDTED";

        public override List<string> AcceptEnvironments => ["resamplingMethod"];

        public override object[] ParameterInfo => [_in_raster, _out_folder, _dted_level.GetGPValue(), _resampling_type.GetGPValue(), _derived_folder];

        /// <summary>
        /// <para>Input Raster</para>
        /// <para>Select a single band raster dataset that represents elevation.</para>
        /// <para>选择表示高程的单个波段栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output Folder</para>
        /// <para>Select a destination where the folder structure and DTED files will be created.</para>
        /// <para>选择将在其中创建文件夹结构和 DTED 文件的目标。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Folder")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_folder { get; set; }


        /// <summary>
        /// <para>DTED Level</para>
        /// <para><xdoc>
        ///   <para>Select an appropriate level based on the resolution of your elevation data.</para>
        ///   <bulletList>
        ///     <bullet_item>Level 0— 900 m</bullet_item><para/>
        ///     <bullet_item>Level 1— 90 m</bullet_item><para/>
        ///     <bullet_item>Level 2—30 m</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>根据高程数据的分辨率选择适当的标高。</para>
        ///   <bulletList>
        ///     <bullet_item>0— 900 米</bullet_item><para/>
        ///     <bullet_item>1 层— 90 米</bullet_item><para/>
        ///     <bullet_item>2 级—30 m</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("DTED Level")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _dted_level_value _dted_level { get; set; }

        public enum _dted_level_value
        {
            /// <summary>
            /// <para>Level 0</para>
            /// <para>Level 0— 900 m</para>
            /// <para>0— 900 米</para>
            /// </summary>
            [Description("Level 0")]
            [GPEnumValue("DTED_0")]
            _DTED_0,

            /// <summary>
            /// <para>Level 1</para>
            /// <para>Level 1— 90 m</para>
            /// <para>1 层— 90 米</para>
            /// </summary>
            [Description("Level 1")]
            [GPEnumValue("DTED_1")]
            _DTED_1,

            /// <summary>
            /// <para>Level 2</para>
            /// <para>Level 2—30 m</para>
            /// <para>2 级—30 m</para>
            /// </summary>
            [Description("Level 2")]
            [GPEnumValue("DTED_2")]
            _DTED_2,

        }

        /// <summary>
        /// <para>Resampling Technique</para>
        /// <para><xdoc>
        ///   <para>Choose an appropriate technique based on the type of data you have.</para>
        ///   <bulletList>
        ///     <bullet_item>Nearest—The fastest resampling method, and it minimizes changes to pixel values. Suitable for discrete data, such as land cover.</bullet_item><para/>
        ///     <bullet_item>Bilinear—Calculates the value of each pixel by averaging (weighted for distance) the values of the surrounding 4 pixels. Suitable for continuous data.</bullet_item><para/>
        ///     <bullet_item>Cubic—Calculates the value of each pixel by fitting a smooth curve based on the surrounding 16 pixels. Produces the smoothest image, but can create values outside of the range found in the source data. Suitable for continuous data.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>根据您拥有的数据类型选择适当的技术。</para>
        ///   <bulletList>
        ///     <bullet_item>最近 - 最快的重采样方法，可最大程度地减少对像素值的更改。适用于离散数据，例如土地覆盖。</bullet_item><para/>
        ///     <bullet_item>双线性 - 通过对周围 4 个像素的值进行平均（按距离加权）来计算每个像素的值。适用于连续数据。</bullet_item><para/>
        ///     <bullet_item>立方体 （Cubic） - 通过基于周围的 16 个像素拟合平滑曲线来计算每个像素的值。生成最平滑的图像，但可能会创建源数据中查找的范围之外的值。适用于连续数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Resampling Technique")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _resampling_type_value _resampling_type { get; set; } = _resampling_type_value._BILINEAR;

        public enum _resampling_type_value
        {
            /// <summary>
            /// <para>Bilinear</para>
            /// <para>Bilinear—Calculates the value of each pixel by averaging (weighted for distance) the values of the surrounding 4 pixels. Suitable for continuous data.</para>
            /// <para>双线性 - 通过对周围 4 个像素的值进行平均（按距离加权）来计算每个像素的值。适用于连续数据。</para>
            /// </summary>
            [Description("Bilinear")]
            [GPEnumValue("BILINEAR")]
            _BILINEAR,

            /// <summary>
            /// <para>Nearest</para>
            /// <para>Nearest—The fastest resampling method, and it minimizes changes to pixel values. Suitable for discrete data, such as land cover.</para>
            /// <para>最近 - 最快的重采样方法，可最大程度地减少对像素值的更改。适用于离散数据，例如土地覆盖。</para>
            /// </summary>
            [Description("Nearest")]
            [GPEnumValue("NEAREST")]
            _NEAREST,

            /// <summary>
            /// <para>Cubic</para>
            /// <para>Cubic—Calculates the value of each pixel by fitting a smooth curve based on the surrounding 16 pixels. Produces the smoothest image, but can create values outside of the range found in the source data. Suitable for continuous data.</para>
            /// <para>立方体 （Cubic） - 通过基于周围的 16 个像素拟合平滑曲线来计算每个像素的值。生成最平滑的图像，但可能会创建源数据中查找的范围之外的值。适用于连续数据。</para>
            /// </summary>
            [Description("Cubic")]
            [GPEnumValue("CUBIC")]
            _CUBIC,

        }

        /// <summary>
        /// <para>Updated Folder</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Folder")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _derived_folder { get; set; }


        public RasterToDTED SetEnv(object resamplingMethod = null)
        {
            base.SetEnv(resamplingMethod: resamplingMethod);
            return this;
        }

    }

}